﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;

namespace Passwords.Models
{
    public class CategoryModel : INavigationNode
    {
        #region statics

        private static  List<CategoryModel> staticCategories;

        public static  List<CategoryModel> Categories
        {
            get
            {
                if (staticCategories == null) staticCategories = CreateCategories();
                return staticCategories;
            }
        }

        private static List<CategoryModel> CreateCategories()
        {
            throw new NotImplementedException();
        }

        #endregion
        #region fields

        private IList<CategoryModel> categories;
        private int index;

        #endregion
        #region ctors dtorss

        private CategoryModel(IList<CategoryModel> categories, int index)
            : base()
        {
            this.categories = categories;
            this.index = index;
        }

        public virtual void Dispose()
        {
        }


        #endregion
        #region methods

        protected virtual Control CreateControl()
        {
            return null;
        }

        #endregion
        #region INavigationNode Members

        INavigationNode INavigationNode.Previous
        {
            get
            {
                return index > 0 ? categories[index - 1] : null;
            }
        }

        INavigationNode INavigationNode.Next
        {
            get
            {
                return index < (categories.Count - 1) ? categories[index + 1] : null;
            }
        }

        #endregion
    }
}
